# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WorkloadManager.V1.Model.WorkloadProfile do
  @moduledoc """
  workload resource

  ## Attributes

  *   `application` (*type:* `GoogleApi.WorkloadManager.V1.Model.Layer.t`, *default:* `nil`) - Optional. The application layer
  *   `ascs` (*type:* `GoogleApi.WorkloadManager.V1.Model.Layer.t`, *default:* `nil`) - Optional. The ascs layer
  *   `database` (*type:* `GoogleApi.WorkloadManager.V1.Model.Layer.t`, *default:* `nil`) - Optional. The database layer
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. such as name, description, version. More example can be found in deployment
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. name of resource names have the form 'projects/{project_id}/workloads/{workload_id}'
  *   `refreshedTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. time when the workload data was refreshed
  *   `sapWorkload` (*type:* `GoogleApi.WorkloadManager.V1.Model.SapWorkload.t`, *default:* `nil`) - The sap workload content
  *   `sqlserverWorkload` (*type:* `GoogleApi.WorkloadManager.V1.Model.SqlserverWorkload.t`, *default:* `nil`) - The sqlserver workload content
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. [output only] the current state if a a workload
  *   `threeTierWorkload` (*type:* `GoogleApi.WorkloadManager.V1.Model.ThreeTierWorkload.t`, *default:* `nil`) - The 3 tier web app workload content
  *   `workloadType` (*type:* `String.t`, *default:* `nil`) - Required. The type of the workload
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :application => GoogleApi.WorkloadManager.V1.Model.Layer.t() | nil,
          :ascs => GoogleApi.WorkloadManager.V1.Model.Layer.t() | nil,
          :database => GoogleApi.WorkloadManager.V1.Model.Layer.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :refreshedTime => DateTime.t() | nil,
          :sapWorkload => GoogleApi.WorkloadManager.V1.Model.SapWorkload.t() | nil,
          :sqlserverWorkload => GoogleApi.WorkloadManager.V1.Model.SqlserverWorkload.t() | nil,
          :state => String.t() | nil,
          :threeTierWorkload => GoogleApi.WorkloadManager.V1.Model.ThreeTierWorkload.t() | nil,
          :workloadType => String.t() | nil
        }

  field(:application, as: GoogleApi.WorkloadManager.V1.Model.Layer)
  field(:ascs, as: GoogleApi.WorkloadManager.V1.Model.Layer)
  field(:database, as: GoogleApi.WorkloadManager.V1.Model.Layer)
  field(:labels, type: :map)
  field(:name)
  field(:refreshedTime, as: DateTime)
  field(:sapWorkload, as: GoogleApi.WorkloadManager.V1.Model.SapWorkload)
  field(:sqlserverWorkload, as: GoogleApi.WorkloadManager.V1.Model.SqlserverWorkload)
  field(:state)
  field(:threeTierWorkload, as: GoogleApi.WorkloadManager.V1.Model.ThreeTierWorkload)
  field(:workloadType)
end

defimpl Poison.Decoder, for: GoogleApi.WorkloadManager.V1.Model.WorkloadProfile do
  def decode(value, options) do
    GoogleApi.WorkloadManager.V1.Model.WorkloadProfile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WorkloadManager.V1.Model.WorkloadProfile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
